import QtQuick 2.15
import QtQuick.Controls 2.15

ApplicationWindow {
    id: root
    visible:true
    property int duration: 4000
    property int padding: 40
    property bool running: false

    height: 500
    width: 500

    Image {
        id: box

        source: '/resources/img/rocket.png'
        x: root.padding
        y: (root.height - height) / 2 // 居于垂直居中
	    
	    NumberAnimation on x {
			to: root.width - box.width - root.padding
		    duration:root.duration
		    running:root.running
	    }
		RotationAnimation on rotation{
			to:360
			duration:root.duration
			running:root.running
		}
    }
    MouseArea {
        anchors.fill: parent

        onClicked: root.running = true
    }
}